package top.lyc829.zzl_android.logic.database.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

import top.lyc829.zzl_android.logic.bean.NoticeSystemBean;

@Dao // database access object
public interface NoticeSystemDao {

    @Insert
    void insertNoticeSystems(NoticeSystemBean...systemBeans);

    @Delete
    void deleteNoticeSystems(NoticeSystemBean...systemBeans);

    @Query("DELETE FROM NOTICE_SYSTEM")
    void deleteAllNoticeSystems();

    @Query("SELECT * FROM NOTICE_SYSTEM WHERE ID = :id LIMIT 1")
    NoticeSystemBean findItemById(Integer id);

    @Query("SELECT * FROM NOTICE_SYSTEM ORDER BY ID DESC")
    List<NoticeSystemBean>  getAllNoticeSystems();

}
